package 代码记录.校招笔试真题.笔试真题_2023.上海金融期货信息技术苏分所;

import java.util.Scanner;

/**
 * @author zx
 * @create 2023-03-29 19:34
 * 100%
 */
public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        boolean res = isOk(n);
        if(res){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
    private static boolean isOk(Integer n){
        if(n < 10){
            return false;
        }
        String str = n.toString();
        for(int i = 1;i < str.length();i++){
            char[] arr1 = str.substring(0,i).toCharArray();
            char[] arr2 = str.substring(i,str.length()).toCharArray();
            int[] temp1 = new int[arr1.length];
            int[] temp2 = new int[arr2.length];
            for(int j = 0;j < arr1.length;j++){
                temp1[j] = arr1[j] - '0';
            }
            for(int j = 0;j < arr2.length;j++){
                temp2[j] = arr2[j] - '0';
            }
            int a = 1;
            int b = 1;
            for(int j = 0;j < temp1.length;j++){
                a = a * temp1[j];
            }
            for(int j = 0;j < temp2.length;j++){
                b = b * temp2[j];
            }
            if(a == b) return true;
        }
        return false;
    }
}
